﻿/*
=============================================================================
Author:魏宝辉通过CodeSmithe生成
CreatedTime:2013-3-15
Description:QUARTZ_SQL_LIST三层结构数据访问层
=============================================================================
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using PWMIS.DataMap.Entity;
using FTchina.Models;//引入模型层
using PWMIS.DataProvider.Data;
namespace FTchina.DAL
{
	public static partial class QUARTZ_SQL_LISTService
	{
        public static QUARTZ_SQL_LIST  GetByPLUGINNAME(string pluginname,AdoHelper ado)
        {
         QUARTZ_SQL_LIST quartz_sql_list = new QUARTZ_SQL_LIST();
       quartz_sql_list.PLUGINNAME=pluginname;
        EntityQuery<QUARTZ_SQL_LIST> query = new EntityQuery<QUARTZ_SQL_LIST>(ado);
        if (query.ExistsEntity(quartz_sql_list))
        {
            query.FillEntity(quartz_sql_list);
            return quartz_sql_list;
        }
        else
        {
            return null;
        }
        }
         public static int  DeleteByPLUGINNAME(string pluginname,AdoHelper ado)
        {
         QUARTZ_SQL_LIST quartz_sql_list = new QUARTZ_SQL_LIST();
       quartz_sql_list.PLUGINNAME=pluginname;
        EntityQuery<QUARTZ_SQL_LIST> query = new EntityQuery<QUARTZ_SQL_LIST>(ado);
         
        return query.Delete(quartz_sql_list);
        }
		 public static int AddOrUpdate(QUARTZ_SQL_LIST quartz_sql_list,AdoHelper ado)
        { 
        EntityQuery<QUARTZ_SQL_LIST> query = new EntityQuery<QUARTZ_SQL_LIST>(ado);
         int i=(query.ExistsEntity(quartz_sql_list))?query.Update(quartz_sql_list):query.Insert(quartz_sql_list);
          return i;
        }
	}
}

